package ooo.reindeer.data.util;

import ooo.reindeer.data.annotation.*;

import java.util.Arrays;


public class StreamData {

    @UnsignedInt16
    int type;

    @UnsignedInt16
    int length;


    @LengthField(value = "length", clazz = StreamData.class)
    @BaseBytes
    byte[] value;

    public int getType() {
        return type;
    }

    public StreamData setType(int type) {
        this.type = type;
        return this;
    }

    public int getLength() {
        return length;
    }

    public StreamData setLength(int length) {
        this.length = length;
        return this;
    }

    public byte[] getValue() {
        return value;
    }

    public StreamData setValue(byte[] value) {
        this.value = value;
        return this;
    }

    @Override
    public String toString() {
        return "StreamData{" +
                "type=" + type +
                ", length=" + length +
                ", value=" + Arrays.toString(value) +
                '}';
    }
}
